<?php
/**
 * Product: rdc_analysis.
 * Date: 18-7-26
 * Time: 上午8:53
 */

namespace helpers;

class RetHelper
{
    const RET_CODE_SUCCESS = 0;

    const RET_CODE_FAILURE = 1;

    public static function jsonEncode( $code = self::RET_SUCCESS, $msg = '成功', $data = null)
    {
        return json_encode( [ 'code' => $code, 'msg' => $msg, 'data' => $data ]);
    }

    public static function makeArrayRet( $code = self::RET_SUCCESS, $msg = '成功', $data = null)
    {
        return [ 'code' => $code, 'msg' => $msg, 'data' => $data ];
    }
}